﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;

namespace WMI.NET.CIM
{
    /// <summary>
    /// The CIM_Fan class represents the capabilities and management of a fan cooling device.
    /// </summary>
    public class CIM_Fan : CIM_CoolingDevice
    {

        private Nullable<UInt64> _DesiredSpeed;
        private Nullable<Boolean> _VariableSpeed;

        /// <summary>
        /// Requested fan speed, defined in revolutions per minute, when a variable speed fan is supported. The current speed is determined by a sensor (CIM_Tachometer) that is associated with the fan using the CIM_AssociatedSensor relationship.
        /// </summary>
        public Nullable<UInt64> DesiredSpeed { get { return _DesiredSpeed; } }

        /// <summary>
        /// If TRUE, the fan supports variable speeds.
        /// </summary>
        public Nullable<Boolean> VariableSpeed { get { return _VariableSpeed; } }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public CIM_Fan(ManagementBaseObject mbo)
            : base(mbo)
        {
            _DesiredSpeed = mbo.GetUlongValue("DesiredSpeed");
            _VariableSpeed = mbo.GetBoolValue("VariableSpeed");
        }

        /// <summary>
        /// The SetSpeed method requests that the fan speed be set to the value specified in the method's input parameter.
        /// </summary>
        /// <param name="DesiredSpeed">Requested fan speed, in revolutions per minute.</param>
        /// <returns></returns>
        public UInt32 SetSpeed(UInt64 DesiredSpeed) { throw new NotImplementedException(); }


    }
}
